package com.rz.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rz.admin.entity.vo.RoleRes;
import com.rz.core.common.model.PageEntity;

import java.time.LocalDateTime;
import java.util.List;

public class Role extends PageEntity {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String roleName;
    private String remark;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime crteTime;
    private Integer crteAdminId;
    private int editabled = 1;
    private Integer orgId;

    @TableField(exist = false)
    private List<RoleRes> resInfo;

    public Role(){}
    public Role(Integer roleId, String roleName, String remark,Integer editabled,Integer crteAdminId) {
        this.id = roleId;
        this.roleName = roleName;
        this.remark = remark;
        this.editabled = editabled;
        if(roleId==null){
            this.crteAdminId = crteAdminId;
            this.crteTime = LocalDateTime.now();
        }
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public LocalDateTime getCrteTime() {
        return crteTime;
    }

    public void setCrteTime(LocalDateTime crteTime) {
        this.crteTime = crteTime;
    }

    public Integer getCrteAdminId() {
        return crteAdminId;
    }

    public void setCrteAdminId(Integer crteAdminId) {
        this.crteAdminId = crteAdminId;
    }

    public int getEditabled() {
        return editabled;
    }

    public void setEditabled(int editabled) {
        this.editabled = editabled;
    }

    public List<RoleRes> getResInfo() {
        return resInfo;
    }

    public void setResInfo(List<RoleRes> resInfo) {
        this.resInfo = resInfo;
    }

    public Integer getOrgId() {
        return orgId;
    }

    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }
}
